package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.entity.Account;
import com.example.mapper.AccountMapper;
import com.example.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shishuqian
 * date 2021/3/23
 * time 18:40
 **/
@Service
public class AccountServiceImpl implements AccountService{

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public Account findByUsername(String username) {

        QueryWrapper wrapper = new QueryWrapper();
        //查询username字段等于username的
        wrapper.eq("username",username);
        return accountMapper.selectOne(wrapper);
    }
}
